package innerclass;

/**
 * @author sjkj
 * @version sjkl
 * @param sjkl
 * @return sk
 *
 */
public abstract class Event {
    private long eventTime;
    protected long delayTime;

    public Event(long delayTime) {
        this.delayTime = delayTime;
        start();
    }

    //start 允许重新开始执行
    public void start(){
        eventTime = System.nanoTime() + delayTime;
    }
    //ready 允许执行
    public boolean ready() {
        return System.nanoTime() >= eventTime;
    }

    public abstract void action();
}
